'use strict';

/* Controllers */
function ModelreviseCtrl($scope, $http) {
	$scope.setSidebar2Menu = function($index){
		$scope.sidebar2Menu = $index;
	}
	$scope.setRightHeaderMenu = function($index){
		$scope.rightHeaderMenu = $index;
	}
	$scope.setSidebarStartHour = function(hourString){
		$scope.sidebarStartHour = hourString;
	}

	$scope.isShowWeatherFactor = function(){
		return $scope.sidebar2Menu == 0;
	}
	$scope.isShowRightHeaderButton = function(){
		return $scope.sidebar2Menu == 0;
	}
	// ----------init options start --------
	//init sidebar2 Tab
	$scope.sidebar2Menus = ["格点订正", "站点订正"];
	//init models, weatherFactors and methods
	$scope.weatherFactors = ["温度", "湿度", "3小时降水", "6小时降水", "12小时降水", "24小时降水"];
	$scope.setSidebar2Menu(0);
	$scope.reviseMethods = ["演化算法订正", "频率匹配订正"];
	
	$scope.models = [{name: "温度", fieldName : "EC"},
	{name: "T639", fieldName : "T639"},
	{name: "NCEP", fieldName : "NCEP"},
	{name: "GRAPES", fieldName : "GRAPES"},
	{name: "日本模式", fieldName : "GapanModel"},
	{name: "德国模式", fieldName : "GermanModel"}];

	//init Date Picker
	$scope.hourOptions =[];
	for (var i = 0; i < 24; i++){
		$scope.hourOptions.push(i + "h");
	}
	//init sidebar2 Tab
	$scope.rightHeaderMenus = ["江苏省", "扬州市"];
	// ----------init options end --------
	
	//init parameters
	$scope.setMenu(1);
	$scope.form = {};
	$scope.sidebar2Menu = 0;
	$scope.sidebarModel = {};
	$scope.models.forEach(function(item){
		$scope.sidebarModel[item.fieldName] = false;
	})
	$scope.sidebarMethod = 0;
	$scope.form.sidebarStartDate = "2016-04-09";
	$scope.form.sidebarEndDate = "2016-04-11";
	$scope.sidebarStartHour = "08h";
	$scope.form.sidebarEndHour = $scope.hourOptions[18];
	$scope.rightHeaderMenu = 0;

	$scope.sidebarWeather = 0;
	$scope.test = function(obj){
		var a = $scope.sidebarSubMenu;
	}
}

